Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unhandled alerts not being properly ignored #779

Merged
merged 1 commit into from
Jun 10, 2024

Conversation

s3cur3
Copy link
Contributor

@s3cur3 s3cur3 commented Jun 10, 2024

This is an improvement over #778. By falling back to the full message value from Chromedriver, we can correctly get the :unexpected_alert condition to match on the bizarre, not-quite-JSON message from Chromedriver like:

    "message" => "unexpected alert open: {Alert text : Error loading data, please refresh and try again}\n  (Session info: chrome-headless-shell=125.0.6422.142)\n  (Driver info: chromedriver=125.0.6422.78 (14db42ec38aded3304a3e624a0a038e02956b87e-refs/branch-heads/6422@{#1088}),platform=Mac OS X 14.5.0 x86_64)"

Applying this patch to my local copy, my default-configured Chromedriver correctly ignores the alert and my tests that passed on v0.36.6 again pass.

This is an improvement over elixir-wallaby#778. By falling back to the full message value from Chromedriver, we can correctly get the `:unexpected_alert` condition to match on the bizarre, not-quite-JSON message from Chromedriver like:

```
    "message" => "unexpected alert open: {Alert text : Error loading data, please refresh and try again}\n  (Session info: chrome-headless-shell=125.0.6422.142)\n  (Driver info: chromedriver=125.0.6422.78 (14db42ec38aded3304a3e624a0a038e02956b87e-refs/branch-heads/6422@{#1088}),platform=Mac OS X 14.5.0 x86_64)"
```

Applying this patch to my local copy, my default-configured Chromedriver correctly ignores the alert and my tests that passed on v0.36.6 again pass.
@mhanberg mhanberg merged commit 2187653 into elixir-wallaby:main Jun 10, 2024
12 of 14 checks passed
@s3cur3 s3cur3 deleted the ty/fix-crash-decoding-json branch June 10, 2024 20:59
alinmarsh pushed a commit to TernSystems/wallaby that referenced this pull request Oct 8, 2024
This is an improvement over elixir-wallaby#778. By falling back to the full message value from Chromedriver, we can correctly get the `:unexpected_alert` condition to match on the bizarre, not-quite-JSON message from Chromedriver like:

```
    "message" => "unexpected alert open: {Alert text : Error loading data, please refresh and try again}\n  (Session info: chrome-headless-shell=125.0.6422.142)\n  (Driver info: chromedriver=125.0.6422.78 (14db42ec38aded3304a3e624a0a038e02956b87e-refs/branch-heads/6422@{#1088}),platform=Mac OS X 14.5.0 x86_64)"
```

Applying this patch to my local copy, my default-configured Chromedriver correctly ignores the alert and my tests that passed on v0.36.6 again pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants